# -*-coding:utf-8-*-
"""
@project: python-project
@Time: 2024-07-13 10:19
@Author: Loneliness_Burial
@File: 修改表.py
@Motto: 深情不改必坠死海
@software: pycharm
@version: python 3.7
"""

import sqlite3

conn = sqlite3.connect('D:\Desktop\LCConfigDataBase')
cursor = conn.cursor()
cursor.execute('ALTER TABLE login ADD COLUMN email TEXT')
cursor.execute('ALTER TABLE login RENAME COLUMN "password" TO "pwd"')   # --修改accounts表中的password字段为pwd
cursor.execute('UPDATE login SET email = "1245@qq.com" WHERE id = "1"')
cursor.execute('UPDATE login SET email = "1235@qq.com" WHERE id = "2"')
cursor.execute('UPDATE login SET email = "1225@qq.com" WHERE id = "3"')
cursor.execute('UPDATE login SET email = "1215@qq.com" WHERE id = "4"')
cursor.execute('SELECT * FROM login')
result = cursor.fetchall()
cursor.close()
conn.commit()
conn.close()
